package com.example.demo.service.impl;

import com.example.demo.entity.CourseQuestion;
import com.example.demo.mapper.CourseQuestionMapper;
import com.example.demo.service.CourseQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseQuestionServiceImpl implements CourseQuestionService {

    @Autowired
    private CourseQuestionMapper courseQuestionMapper;

    @Override
    public int insertCourseQuestion(CourseQuestion courseQuestion) {
        return courseQuestionMapper.insertCourseQuestion(courseQuestion);
    }

    @Override
    public int deleteCourseQuestionById(int id) {
        return courseQuestionMapper.deleteCourseQuestionById(id);
    }

    @Override
    public int updateCourseQuestion(CourseQuestion courseQuestion) {
        return courseQuestionMapper.updateCourseQuestion(courseQuestion);
    }

    @Override
    public CourseQuestion selectCourseQuestionById(int id) {
        return courseQuestionMapper.selectCourseQuestionById(id);
    }

    @Override
    public List<CourseQuestion> selectAllCourseQuestions() {
        return courseQuestionMapper.selectAllCourseQuestions();
    }

    @Override
    public List<CourseQuestion> selectCourseQuestionsByCourseId(int courseId) {
        return courseQuestionMapper.selectCourseQuestionsByCourseId(courseId);
    }

    @Override
    public List<CourseQuestion> selectCourseQuestionsByTeacherId(int teacherId) {
        return courseQuestionMapper.selectCourseQuestionsByTeacherId(teacherId);
    }
}